package com.jl.smartcard.ui.views.cmds;

import java.util.HashMap;
import java.util.Map;


public class CMDs3G implements Group{

	public final static String ID = "3: 3G CMDs";
	private final static Map<String, String> cmdsMode3G = new HashMap<String, String>();

	static {
		// 3G
		cmdsMode3G.put("SELECT FILE", "00 A4 08 04 xx FILEPATH");
		cmdsMode3G.put("STATUS", "80 F2 00 00 00");
		cmdsMode3G.put("READ BINARY", "00 B0 00 00 LEN");
		cmdsMode3G.put("UPDATE BINARY", "00 D6 00 00 xx DATA");
		cmdsMode3G.put("READ RECORD", "00 B2 RecNo Mode LEN");
		cmdsMode3G.put("UPDATE RECORD", "00 DC RecNo Mode xx DATA");
		cmdsMode3G.put("SEARCH RECORD", "00 A2 01 04 xx Pattern");
		cmdsMode3G.put("INCREASE", "80 32 00 00 xx DATA");

		cmdsMode3G.put("RETRIEVE DATA", "80 CB 00 00 xx DATA");
		cmdsMode3G.put("SET DATA", "80 DB 00 00 xx BERTLV");

		cmdsMode3G.put("VERIFY PIN", "00 20 00 PINNo 08 CHV");
		cmdsMode3G.put("CHANGE PIN", "00 24 00 PINNo 10 OldCHV NewCHV");
		cmdsMode3G.put("DISABLE PIN", "00 26 00 PINNo 08 CHV");
		cmdsMode3G.put("ENABLE PIN", "00 28 00 PINNo 08 CHV");
		cmdsMode3G.put("UNBLOCK PIN", "00 2C 00 PINNo 10 UK NewCHV");
		cmdsMode3G.put("DEACTIVATE FILE", "00 04 00 00 00");
		cmdsMode3G.put("ACTIVATE FILE", "00 44 00 00 00");

		cmdsMode3G.put("AUTHENTICATE", "00 88 00 00 xx DATA");
		cmdsMode3G.put("GET CHALLENGE", "00 84 00 00 EXP");
		cmdsMode3G.put("TERMINAL CAPABILITY", "80 AA 00 00 xx DATA");

		cmdsMode3G.put("TERMINAL PROFILE", "80 10 00 00 xx DATA");
		cmdsMode3G.put("ENVELOPE", "80 C2 00 00 xx DATA");
		cmdsMode3G.put("FETCH", "80 12 00 00 LEN");
		cmdsMode3G.put("TERMINAL RESPONSE", "80 14 00 00 xx DATA");

		cmdsMode3G.put("MANAGE CHANNEL", "00 70 00 00");
		cmdsMode3G.put("MANAGE SECURE CHANNEL", "00 73 00 00 EXP");
		cmdsMode3G.put("TRANSACT DATA", "00 75 00 00");

		cmdsMode3G.put("GET RESPONSE", "00 C0 00 00 LEN");

	}

	@Override
	public Map<String, String> getCMDs() {
		return cmdsMode3G;
	}

	@Override
	public String wrap(String cmd) {
		StringBuilder sb = new StringBuilder();
		sb.append("a('").append(cmd).append("');");
		return sb.toString();
	}

	@Override
	public String get(String key) {
		return cmdsMode3G.get(key);
	}

}
